home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / dragon-runner.swf / scripts / RunningKnight.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  3.7 KB  |  124 lines

  1. package
  2. {
  3.    import flash.display.Sprite;
  4.    import flash.events.Event;
  5.    
  6.    public class RunningKnight extends Sprite
  7.    {
  8.        
  9.       
  10.       private var ┬º\x01\x01\x02\t┬º:*;
  11.       
  12.       private var ┬º\x01\x01\x02\x0b┬º:*;
  13.       
  14.       public var enemyChar:*;
  15.       
  16.       private var ┬º\x01\x01\x02\r┬º:*;
  17.       
  18.       private var scoreMgr:*;
  19.       
  20.       private var ┬º\x01\x01\x02\x0e┬º:*;
  21.       
  22.       private var ┬º\x01\x01\x02\x0f┬º:*;
  23.       
  24.       private var ┬º\x01\x01\x02\x10┬º:*;
  25.       
  26.       private var ┬º\x01\x01\x03\x01┬º:*;
  27.       
  28.       private var ┬º\x01\x01\x03\x02┬º:*;
  29.       
  30.       public var mainChar:*;
  31.       
  32.       private var ┬º\x01\x01\x03\x03┬º:Boolean = false;
  33.       
  34.       public function RunningKnight(param1:*)
  35.       {
  36.          ┬º\x01\x01\x03\x03┬º = false;
  37.          super();
  38.          ┬º\x01\x01\x02\t┬º = param1;
  39.       }
  40.       
  41.       private function ┬º\x01\x01\x02\n┬º(param1:Event) : *
  42.       {
  43.          if(┬º\x01\x01\x03\x03┬º && ┬º\x01\x01\x02\x10┬º.GetKnightStatus() == 999)
  44.          {
  45.             StopGame(true);
  46.             ┬º\x01\x01\x02\t┬º.removeEventListener(Event.ENTER_FRAME,┬º\x01\x01\x02\n┬º);
  47.          }
  48.       }
  49.       
  50.       public function PlaySound(param1:int) : *
  51.       {
  52.          ┬º\x01\x01\x03\x01┬º.stopBgm();
  53.          if(param1 > 0)
  54.          {
  55.             ┬º\x01\x01\x03\x01┬º.playBgm(param1);
  56.          }
  57.       }
  58.       
  59.       public function ┬º\x01\x01\x02\f┬º() : *
  60.       {
  61.          ┬º\x01\x01\x03\x01┬º.stopBgm();
  62.       }
  63.       
  64.       public function GetScore() : int
  65.       {
  66.          return scoreMgr.GetScore();
  67.       }
  68.       
  69.       public function StopGame(param1:*) : *
  70.       {
  71.          ┬º\x01\x01\x03\x01┬º.stopBgm();
  72.          ┬º\x01\x01\x02\r┬º.StopGame();
  73.          scoreMgr.StopGame();
  74.          ┬º\x01\x01\x02\x10┬º.StopGame();
  75.          ┬º\x01\x01\x02\x0f┬º.StopGame();
  76.          ┬º\x01\x01\x03\x02┬º.StopGame();
  77.          ┬º\x01\x01\x02\x0b┬º.StopGame();
  78.          ┬º\x01\x01\x03\x03┬º = false;
  79.          if(param1)
  80.          {
  81.             ┬º\x01\x01\x02\x0e┬º.ShowGameOver();
  82.          }
  83.          else
  84.          {
  85.             ┬º\x01\x01\x02\x0e┬º.ShowEndMovie();
  86.          }
  87.       }
  88.       
  89.       public function StartGame() : *
  90.       {
  91.          ┬º\x01\x01\x03\x01┬º.stopBgm();
  92.          ┬º\x01\x01\x03\x01┬º.playBgm(2);
  93.          ┬º\x01\x01\x02\r┬º.StartGame();
  94.          scoreMgr.StartGame();
  95.          ┬º\x01\x01\x02\x10┬º.StartGame();
  96.          mainChar = ┬º\x01\x01\x02\x10┬º.theKnight;
  97.          ┬º\x01\x01\x02\x0f┬º.StartGame();
  98.          enemyChar = ┬º\x01\x01\x02\x0f┬º.theDragon;
  99.          ┬º\x01\x01\x03\x02┬º.StartGame();
  100.          ┬º\x01\x01\x02\x0b┬º.StartGame();
  101.          ┬º\x01\x01\x03\x03┬º = true;
  102.          ┬º\x01\x01\x02\t┬º.addEventListener(Event.ENTER_FRAME,┬º\x01\x01\x02\n┬º,false,0,true);
  103.       }
  104.       
  105.       public function GetPercentDone() : int
  106.       {
  107.          return ┬º\x01\x01\x03\x02┬º.obstacleCount / 2;
  108.       }
  109.       
  110.       public function Exec() : *
  111.       {
  112.          ┬º\x01\x01\x02\r┬º = new WorldManager(┬º\x01\x01\x02\t┬º,this);
  113.          scoreMgr = new ScoreManager(┬º\x01\x01\x02\t┬º,┬º\x01\x01\x02\r┬º);
  114.          ┬º\x01\x01\x02\x0e┬º = new MenuManager(┬º\x01\x01\x02\t┬º,┬º\x01\x01\x02\r┬º,this);
  115.          ┬º\x01\x01\x03\x01┬º = new SoundManager();
  116.          ┬º\x01\x01\x02\x10┬º = new PlayerManager(┬º\x01\x01\x02\t┬º,┬º\x01\x01\x02\r┬º,scoreMgr);
  117.          ┬º\x01\x01\x02\x0f┬º = new EnemyManager(┬º\x01\x01\x02\t┬º,┬º\x01\x01\x02\r┬º,this);
  118.          ┬º\x01\x01\x03\x02┬º = new ObstacleManager(┬º\x01\x01\x02\t┬º,┬º\x01\x01\x02\r┬º,this);
  119.          ┬º\x01\x01\x02\x0b┬º = new ItemManager(┬º\x01\x01\x02\t┬º,┬º\x01\x01\x02\r┬º,┬º\x01\x01\x02\x10┬º);
  120.          ┬º\x01\x01\x02\x0e┬º.CreateMainMenu();
  121.       }
  122.    }
  123. }
  124.